package com.example.demo.controller;

import java.util.Date;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class JackController {

	@RequestMapping("/test")
	@PreAuthorize("hasAuthority('ROLE_user')")
	public String sayHello() {
		return "god "+new Date().toLocaleString();
	}
	
	@RequestMapping("/bk")
	@PreAuthorize("hasRole('user')")
	public String sayaHello() {
		return "goda "+new Date().toLocaleString();
	}	
	
	
	
}
